-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android|iOS] overwrite system sound for push notifications via a custom one #36807
[Android|iOS] overwrite system sound for push notifications via a custom one #36807
Conversation
@abdulrahuman5196 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I'm generating some test builds.
...d/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Android isn't working for me, I still get the default notification sound.
Can you try to clean app data or do a clean installation? I had the same problem - it seems like if channel is created then it's kind of persisted, so the modified code (new sound) will not be applied. |
Yep, working now on Android 👍 iOS is going to be a problem to test though, I might need to build locally |
By the way I still think it's a bug, because if we publish a new version, then people will have to re-install app in order not to hear default sound - maybe we need to find a way on how to invalidate channel without an additional user interaction? |
Ah, seems like a new channel is the solution. Though I'd rather not do that. We've barely started to migrate users yet so this isn't really a problem
|
I thought about deleting an old channel and creating a new one (and adding versioning to this). But if it's not a problem, then okay 🙂 |
Hey @abdulrahuman5196 can you review this, excluding iOS? For Android the generated build should work, and for the other platforms we should still here the received message sound. |
@kirillzyusko I think the test steps are wrong. We want two tests, one for iOS/Android and another for the other platforms to ensure the sound plays |
Sure @Julesssss will work on testing |
@Julesssss I updated test steps 👍 |
@kirillzyusko Couple of auto-checks are failing for this PR? Could you kindly check on the same? @Julesssss Could you kindly generate builds again, since we had changes after the last build? |
Build in progress 👍 |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
@kirillzyusko I see there's a podfile error, have you been able to build ios and test that the audio doesn't play when a simulator receives a message? |
@Julesssss I think I also had a changed Podfile after Pods installation, but it wasn't related to changes that I did, so I thought that problem comes from |
@kirillzyusko can you add screenshots and check that item off the list please |
Does this mean only messages without any markdown? I hear sound for message I have strikethrough and italic features added. Am I mis-understanding something here? But anyways I tested android and I get the custom sound for all types of push notification in android. |
@abdulrahuman5196 no, presence of markdown in messages shouldn't make any impact. By "plain" messages I meant all messages excluding mentions/money transfers/task completion/etc. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeaz_recorder_20240222_001933.mp4Android: mWeb Chromeaz_recorder_20240222_002259.mp4iOS: NativeiOS: mWeb SafariRecording.62.MOVMacOS: Chrome / SafariScreen.Recording.2024-02-22.at.12.46.30.AM.movMacOS: DesktopScreen.Recording.2024-02-22.at.12.50.16.AM.mov |
@Julesssss I am unable to test in iOS native alone, since I am not part of the development profile like here https://expensify.slack.com/archives/C02NK2DQWUX/p1698038568836489 I tested on other platforms. Could you kindly test in iOS native and have a quick look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good and works well. Reviewers checklist is also complete.
All yours. @Julesssss
🎀 👀 🎀
C+ Reviewed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really struggling to get our dev iOS build working on a phyiscal device (required for push notification testing).
I've asked for help, but I fear we may have recently broken our env configuration. I'll return to this PR review once I have resolved my issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's currently impossible to test this on iOS, so I'll test on staging with an InternalQA blocker. If necessary I will revert
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/Julesssss in version: 1.4.44-0 🚀
|
Okay, I have verified Android, and @dylanexpensify has verified Android. Excellent 🎉 |
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.44-13 🚀
|
Details
Based on the assumption, that we receive push-notification only for plain messages -> we can skip a call to
playSound(SOUNDS.RECEIVE)
and change a native code to play areceive
sound (that's exactly what I did in this PR).Fixed Issues
$ #36579
$ #36714
PROPOSAL: N/A
Tests
Offline tests
Not needed.
QA Steps
For Android, you should completely uninstall and reinstall the app first!
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop